# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ReplicaPool.V1beta1.Model.Template do
  @moduledoc """
  The template used for creating replicas in the pool.

  ## Attributes

  *   `action` (*type:* `GoogleApi.ReplicaPool.V1beta1.Model.Action.t`, *default:* `nil`) - An action to run during initialization of your replicas. An action is run as shell commands which are executed one after the other in the same bash shell, so any state established by one command is inherited by later commands.
  *   `healthChecks` (*type:* `list(GoogleApi.ReplicaPool.V1beta1.Model.HealthCheck.t)`, *default:* `nil`) - A list of HTTP Health Checks to configure for this replica pool and all virtual machines in this replica pool.
  *   `version` (*type:* `String.t`, *default:* `nil`) - A free-form string describing the version of this template. You can provide any versioning string you would like. For example, version1 or template-v1.
  *   `vmParams` (*type:* `GoogleApi.ReplicaPool.V1beta1.Model.VmParams.t`, *default:* `nil`) - The virtual machine parameters to use for creating replicas. You can define settings such as the machine type and the image of replicas in this pool. This is required if replica type is SMART_VM.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :action => GoogleApi.ReplicaPool.V1beta1.Model.Action.t(),
          :healthChecks => list(GoogleApi.ReplicaPool.V1beta1.Model.HealthCheck.t()),
          :version => String.t(),
          :vmParams => GoogleApi.ReplicaPool.V1beta1.Model.VmParams.t()
        }

  field(:action, as: GoogleApi.ReplicaPool.V1beta1.Model.Action)
  field(:healthChecks, as: GoogleApi.ReplicaPool.V1beta1.Model.HealthCheck, type: :list)
  field(:version)
  field(:vmParams, as: GoogleApi.ReplicaPool.V1beta1.Model.VmParams)
end

defimpl Poison.Decoder, for: GoogleApi.ReplicaPool.V1beta1.Model.Template do
  def decode(value, options) do
    GoogleApi.ReplicaPool.V1beta1.Model.Template.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ReplicaPool.V1beta1.Model.Template do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
